/*
 * Copyright (c) 2008 Benoit Bouchez, Nicolas Giard
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
package com.noocodecommit.wicket.stuff.jquery.plugin.chili;

import com.noocodecommit.wicket.stuff.jquery.plugin.JQPluginOptions;

/**
 * JQChili Option set
 * 
 * @author Benoit Bouchez
 * 
 */
public class JQChiliOptions extends JQPluginOptions
{
	private boolean automatic = true;
	private boolean lineNumbers = false;
	private boolean recipeLoading = true;
	private String automaticSelector = "code";
	private String codeLanguage = "function(el){var recipeName = $(el).attr('class'); return recipeName ? recipeName : '';}";
	private String recipeFolder = "";
	private String replaceSpace = "&#160;";
	private String replaceTab = "&#160;&#160;&#160;&#160;";
	private String replaceNewLine = "&#160;<br/>";
	private String selectionStyle = "['position:absolute; z-index:3000; overflow:scroll;', 'width:16em;', 'height:9em;', 'border:1px solid gray;', 'padding:15px;', 'background-color:yellow;'].join( ' ' )";

	/**
	 * Constructor
	 */
	public JQChiliOptions()
	{
		super();
		this.setDefaultHeader("chili");
	}

	/**
	 * Gets the automatic value
	 * 
	 * @return the automatic value
	 */
	public boolean isAutomatic()
	{
		return automatic;
	}

	/**
	 * Sets the automatic option value
	 * 
	 * @param automatic
	 *            chili automatic
	 */
	public void setAutomatic(boolean automatic)
	{
		this.automatic = automatic;
		this.options.put("automatic", "automatic:" + automatic);
	}

	/**
	 * Gets the lineNumber value
	 * 
	 * @return the lineNumber value
	 */
	public boolean isLineNumbers()
	{
		return lineNumbers;
	}

	/**
	 * Sets the lineNumbers option value
	 * 
	 * @param lineNumbers
	 *            chili lineNumbers
	 */
	public void setLineNumbers(boolean lineNumbers)
	{
		this.lineNumbers = lineNumbers;
		this.options.put("lineNumbers", "lineNumbers:" + lineNumbers);
	}

	/**
	 * Gets the recipeLoading value
	 * 
	 * @return the recipeLoading value
	 */
	public boolean isRecipeLoading()
	{
		return recipeLoading;
	}

	/**
	 * Sets the recipeLoading option value
	 * 
	 * @param recipeLoading
	 *            chili recipeLoading
	 */
	public void setRecipeLoading(boolean recipeLoading)
	{
		this.recipeLoading = recipeLoading;
		this.options.put("recipeLoading", "recipeLoading:" + recipeLoading);
	}

	/**
	 * Gets the automaticSelector value
	 * 
	 * @return the automaticSelector value
	 */
	public String getAutomaticSelector()
	{
		return automaticSelector;
	}

	/**
	 * Sets the automaticSelector option value
	 * 
	 * @param automaticSelector
	 *            chili automaticSelector
	 */
	public void setAutomaticSelector(String automaticSelector)
	{
		this.automaticSelector = automaticSelector;
		this.options.put("automaticSelector", "automaticSelector:'" + automaticSelector + "'");
	}

	/**
	 * Gets the codeLanguage value
	 * 
	 * @return the codeLanguage value
	 */
	public String getCodeLanguage()
	{
		return codeLanguage;
	}

	/**
	 * Sets the codeLanguage option value
	 * 
	 * @param codeLanguage
	 *            chili codeLanguage
	 */
	public void setCodeLanguage(String codeLanguage)
	{
		this.codeLanguage = codeLanguage;
		this.options.put("codeLanguage", "codeLanguage:'" + codeLanguage + "'");
	}

	/**
	 * Gets the recipeFolder value
	 * 
	 * @return the recipeFolder value
	 */
	public String getRecipeFolder()
	{
		return recipeFolder;
	}

	/**
	 * Sets the recipeFolder option value
	 * 
	 * @param recipeFolder
	 *            chili recipeFolder
	 */
	public void setRecipeFolder(String recipeFolder)
	{
		this.recipeFolder = recipeFolder;
		this.options.put("recipeFolder", "recipeFolder:'" + recipeFolder + "'");
	}

	/**
	 * Gets the replaceSpace value
	 * 
	 * @return the replaceSpace value
	 */
	public String getReplaceSpace()
	{
		return replaceSpace;
	}

	/**
	 * Sets the replaceSpace option value
	 * 
	 * @param replaceSpace
	 *            chili replaceSpace
	 */
	public void setReplaceSpace(String replaceSpace)
	{
		this.replaceSpace = replaceSpace;
		this.options.put("replaceSpace", "replaceSpace:'" + replaceSpace + "'");
	}

	/**
	 * Gets the replaceTab value
	 * 
	 * @return the replaceTab value
	 */
	public String getReplaceTab()
	{
		return replaceTab;
	}

	/**
	 * Sets the replaceTab option value
	 * 
	 * @param replaceTab
	 *            chili replaceTab
	 */
	public void setReplaceTab(String replaceTab)
	{
		this.replaceTab = replaceTab;
		this.options.put("replaceTab", "replaceTab:'" + replaceTab + "'");
	}

	/**
	 * Gets the replaceNewLine value
	 * 
	 * @return the replaceNewLine value
	 */
	public String getReplaceNewLine()
	{
		return replaceNewLine;
	}

	/**
	 * Sets the replaceNewLine option value
	 * 
	 * @param replaceNewLine
	 *            chili replaceNewLine
	 */
	public void setReplaceNewline(String replaceNewLine)
	{
		this.replaceNewLine = replaceNewLine;
		this.options.put("replaceNewLine", "replaceNewLine:'" + replaceNewLine + "'");
	}

	/**
	 * Gets the selectionStyle value
	 * 
	 * @return the selectionStyle value
	 */
	public String getSelectionStyle()
	{
		return selectionStyle;
	}

	/**
	 * Sets the selectionStyle option value
	 * 
	 * @param selectionStyle
	 *            chili selectionStyle
	 */
	public void setSelectionStyle(String selectionStyle)
	{
		this.selectionStyle = selectionStyle;
		this.options.put("selectionStyle", "selectionStyle:'" + selectionStyle + "'");
	}

}
